from django import forms
from .models import User


class UserForm(forms.ModelForm):
    class Meta:
        model = User
        fields = ['username', 'password', 'gender', 'age']

    def __init__(self, *args, **kwargs):
        super(UserForm, self).__init__(*args, **kwargs)
        # self.fields['id'].lable = '序号'
        self.fields['username'].lable = '用户名'
        self.fields['password'].lable = '密码'
        self.fields['gender'].lable = '性别'
        self.fields['age'].lable = '年龄'
        # self.fields['createDatetime'].lable = '日期'